<%@page import="com.bean.Man"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>EL表达式取变量、对象属性、空；隐含对象</title>
</head>
<body>
	${'将变量储存到jsp四大空间，然后全部拿出:' }
	<br />
	<%
		int a = 5;
		float b = 2.3f;
		boolean c = true;
		String d = "hello";

		pageContext.setAttribute("A", a);
		request.setAttribute("B", b);
		session.setAttribute("C", c);
		application.setAttribute("D", d);
	%>
	${'不限定空间范围，全部拿出：' }
	<br /> ${A }
	<br /> ${B }
	<br /> ${C }
	<br /> ${D }
	<br />${'限定空间范围，全部拿出：' }
	<br /> ${pageScope.A }
	<br /> ${requestScope.B }
	<br /> ${sessionScope.C }
	<br /> ${applicationScope.D }
	<br />${'**************************************************' }
	<br />${'创建对象，读取对象或者对象的属性值：' }
	<%
		Man man = new Man("张三", "男", 23, "陕西省");
		session.setAttribute("man", man);
	%>
	<br />${sessionScope.man }
	<br />${sessionScope.man.name }
	<br />${sessionScope.man['address'] }
	<br />${'**************************************************' }
	<br />${'空内容判断：' }
	<br />${empty '你好' }
	<br />${empty '' }
	<br />${empty null }
	<br />${not empty null }
	<br />${'**************************************************' }
	<br />${'EL表达式隐含对象：' }
	<br />${param.username }
	<br />${param['username']}
	<br />


	<%
		Cookie cookie = new Cookie("cookie_name", "cookie_value");
		cookie.setMaxAge(200);
		response.addCookie(cookie);
	%>
	<br />${cookie['cookie_name'].value }
</body>
</html>